package com.tang.controller;

import com.tang.pojo.ScheduleJob;
import com.tang.service.JobTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller
public class IndexController {

    @Autowired
    private JobTaskService taskService;

    /**
     * 获取所有作业任务列表
     *
     * @return
     */
    @GetMapping(value = "/")
    public String taskList(Model model) {
        List<ScheduleJob> taskList = taskService.getAllTask();
        model.addAttribute("taskList", taskList);
        return "taskList";
    }
}
